/* 游戏页面样式 - 极简风格 */
body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #f0f0f0;
    overflow-x: hidden;
}

.loading-mask {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-text {
    color: white;
    font-size: 2rem;
    font-weight: bold;
    animation: pulse 1.5s infinite;
}

@media (max-width: 768px) {
    .loading-text {
        font-size: 1.5rem;
    }
}

@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

.card.front {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3rem;
    font-weight: bold;
    color: #333;
    position: relative;
    content: attr(data-suit);
}

@media (max-width: 768px) {
    .card.front {
        font-size: 2rem;
    }
}

.card.front::before {
    content: attr(data-rank);
    position: absolute;
    top: 5px;
    left: 5px;
    font-size: 1.2rem;
}

.card.small-card.front::before {
    font-size: 0.8rem;
    top: 3px;
    left: 3px;
}

.card.front::after {
    content: attr(data-suit);
    position: absolute;
    bottom: 5px;
    right: 5px;
    font-size: 1.2rem;
}

.card.small-card.front::after {
    font-size: 0.8rem;
    bottom: 3px;
    right: 3px;
}

/* 花色样式 */
.card.hearts, .card.diamonds {
    color: #e74c3c;
}

.card.clubs, .card.spades {
    color: #333;
}

* {
    box-sizing: border-box;
}

.game-container {
    text-align: center;
    background-color: white;
    min-height: 100vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.game-header {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.game-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 10px;
    border-bottom: 1px solid #eee;
}

@media (min-width: 768px) {
    .game-main {
        flex-direction: row;
    }
}

/* 横屏模式优化 - 适配iPhone 15/小米15等设备 */
@media (orientation: landscape) and (max-width: 992px) {
    .game-header,
    .game-footer {
        padding: 5px;
    }
    
    .card {
        width: 10vw;
        height: 15vw;
        max-width: 70px;
        max-height: 105px;
    }
    
    .cardYS {
        width: 10vw;
        height: 15vw;
        max-width: 70px;
        max-height: 105px;
    }
    
    .game-main {
        flex-direction: row;
        padding: 5px;
    }
    
    .game-info {
        padding: 5px;
        margin: 5px;
    }
    
    .public-cards,
    .player-cards,
    .my-cards {
        padding: 3px 0;
    }
}

.game-footer {
    flex: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 10px;
    margin-top: auto;
}

/* 扑克牌样式 */
.card {
    width: 12vw;
    max-width: 80px;
    height: 18vw;
    max-height: 120px;
    border: 1px solid #ccc;
    border-radius: 8px;
    margin: 0 2vw;
    background-color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
}

@media (max-width: 768px) {
    .card {
        width: 15vw;
        height: 22vw;
        margin: 0 1vw;
    }
}

/* 扑克牌样式 */
.cardYS {
    width: 12vw;
    max-width: 80px;
    height: 18vw;
    max-height: 120px;
    border: 0px solid #ccc;
    border-radius: 8px;
    margin: 0 2vw;
    background-color: rgba(255, 255, 255, 0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0);
    transition: all 0.2s ease;
}

@media (max-width: 768px) {
    .cardYS {
        width: 15vw;
        height: 22vw;
        margin: 0 1vw;
    }
}

.card.deck {
    background-color: #e74c3c;
}

.card.back {
    background-color: #34495e;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="60" height="80" viewBox="0 0 60 80"><rect width="60" height="80" fill="%2334495e"/><path d="M15,20 L45,60 M45,20 L15,60" stroke="rgba(255,255,255,0.3)" stroke-width="2"/><circle cx="30" cy="40" r="8" fill="rgba(255,255,255,0.1)"/></svg>');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* 区域布局样式 */
.public-cards,
.player-cards,
.my-cards {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    padding: 5px 0;
}

.my-cards .card:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    border-color: #e74c3c;
}

/* 选中卡牌样式 */
.card.selected {
    border-color: #e74c3c; /* 红色边框 - 辅助色 */
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(231, 76, 60, 0.5);
    outline: 2px solid #e74c3c;
}

.player-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.game-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    border-left: none;
    border-right: none;
    padding: 10px;
    margin: 10px 0;
}

@media (min-width: 768px) {
    .game-info {
        border-left: 1px solid #eee;
        border-right: 1px solid #eee;
        border-top: none;
        border-bottom: none;
        margin: 0;
    }
}

.game-status {
    margin-bottom: 15px;
    font-size: 1rem;
    color: #333;
}

@media (orientation: landscape) and (max-width: 992px) {
    .game-status {
        margin-bottom: 8px;
        font-size: 0.9rem;
    }
}

.public-info-cards {
    display: flex;
    justify-content: center;
    margin-top: 10px;
}

.player-info {
    margin-top: 15px;
    font-size: clamp(0.8rem, 2vw, 0.9rem);
    color: #666;
    width: 100%;
    text-align: center;
}

@media (orientation: landscape) and (max-width: 992px) {
    .player-info {
        margin-top: 8px;
        font-size: clamp(0.7rem, 1.5vw, 0.8rem);
    }
}

/* 准备按钮样式 */
#prepareButton {
    background-color: #3498db; /* 蓝色 - 辅助色 */
    color: white; /* 白色文字 */
    border: none; /* 无边框 */
    padding: 8px 16px; /* 内边距 */
    font-size: 1rem; /* 字体大小 */
    border-radius: 4px; /* 轻微圆角 */
    cursor: pointer; /* 鼠标指针样式 */
    transition: all 0.3s ease; /* 过渡效果 */
    outline: none; /* 移除默认轮廓 */
}

@media (max-width: 768px) {
    #prepareButton {
        padding: 6px 12px;
        font-size: 0.9rem;
    }
}

#prepareButton:hover {
    background-color: #2980b9; /* 深一点的蓝色 - 悬停效果 */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); /* 轻微阴影 */
    transform: translateY(-1px); /* 微小上浮效果 */
}

#prepareButton:active {
    transform: translateY(1px); /* 点击时下沉效果 */
}

#prepareButton:disabled {
    background-color: #bdc3c7; /* 禁用状态颜色 */
    cursor: not-allowed; /* 禁用指针样式 */
    transform: none; /* 禁用变换效果 */
    box-shadow: none; /* 禁用阴影 */
}

.my-player-area {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
}

p {
    color: #666;
    font-size: 1rem;
    line-height: 1.6;
}

.play-card-btn {
    background-color: #3498db; /* 蓝色 - 辅助色 */
    color: white; /* 白色文字 */
    border: none; /* 无边框 */
    padding: 8px 16px; /* 内边距 */
    font-size: 1rem; /* 字体大小 */
    border-radius: 4px; /* 轻微圆角 */
    cursor: pointer; /* 鼠标指针样式 */
    transition: all 0.3s ease; /* 过渡效果 */
    outline: none; /* 移除默认轮廓 */
    margin-left: 15px; /* 与卡牌间距 */
}

@media (max-width: 768px) {
    .play-card-btn {
        padding: 6px 12px;
        font-size: 0.9rem;
        margin-left: 8px;
    }
}

.play-card-btn:hover {
    background-color: #2980b9; /* 深一点的蓝色 - 悬停效果 */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); /* 轻微阴影 */
    transform: translateY(-1px); /* 微小上浮效果 */
}

.play-card-btn:active {
    transform: translateY(1px); /* 点击时下沉效果 */
}

.play-card-btn:disabled {
    background-color: #bdc3c7; /* 禁用状态颜色 */
    cursor: not-allowed; /* 禁用指针样式 */
    transform: none; /* 禁用变换效果 */
    box-shadow: none; /* 禁用阴影 */
}

/* 结算模块样式 */
.result-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: none; /* 默认隐藏 */
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.result-container {
    background-color: white;
    padding: 15px;
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

@media (orientation: landscape) and (max-width: 992px) {
    .result-container {
        max-width: 90vw;
        max-height: 80vh;
        overflow-y: auto;
        padding: 10px;
    }
}

.round-title {
    font-size: 2rem;
    font-weight: bold;
    color: #333;
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

@media (max-width: 768px) {
    .round-title {
        font-size: 1.5rem;
        margin-bottom: 15px;
        padding-bottom: 8px;
    }
}

.players-results {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.player-result {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

@media (orientation: landscape) and (max-width: 992px) {
    .player-result {
        padding: 10px 8px;
        gap: 5px;
    }
}

.player-result.winner {
    background-color: #3498db; /* 蓝色背景标识获胜者 */
    color: white;
}

.player-name {
    font-size: clamp(0.9rem, 3vw, 1.1rem);
    font-weight: 500;
    width: 25%;
    min-width: 60px;
}

.player-cards-small {
    display: flex;
    justify-content: center;
    flex-grow: 1;
}

.card.small-card {
    width: 50px;
    height: 70px;
    font-size: 1.5rem;
    margin: 0 5px;
}

@media (orientation: landscape) and (max-width: 992px) {
    .card.small-card {
        width: 40px;
        height: 56px;
        font-size: 1.2rem;
        margin: 0 3px;
    }
}

.player-score {
    font-size: clamp(0.9rem, 3vw, 1.1rem);
    font-weight: 500;
    width: 25%;
    min-width: 80px;
    text-align: right;
}

.red{
    color: red;
}

/* 结算确认按钮样式 */
.confirm-btn {
    background-color: #3498db; /* 蓝色 - 辅助色 */
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
    width: 100%;
}

@media (orientation: landscape) and (max-width: 992px) {
    .confirm-btn {
        padding: 6px 12px;
        font-size: 0.9rem;
        margin-top: 10px;
    }
}

@media (max-width: 768px) {
    .confirm-btn {
        padding: 8px 16px;
        font-size: 0.9rem;
        margin-top: 15px;
    }
}

.confirm-btn:hover {
    background-color: #2980b9;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
}

.confirm-btn:active {
    transform: translateY(1px);
}